package com.cos.hospital.ui.other.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cos.hospital.R;
import com.cos.hospital.model.bean.AcupointBean;

import java.util.List;

public class AdapterAcupoint extends BaseQuickAdapter<AcupointBean, BaseViewHolder> {

    public AdapterAcupoint(@Nullable List<AcupointBean> data) {
        super(R.layout.item_acupoint_show, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AcupointBean item) {
        helper.setText(R.id.rec_acu_name, item.getFldAcupointName());
        //双侧 = 0,左侧 = 1,右侧 = 2,单侧 = 3
        switch (item.getFldAcupointType()) {
            case 0:
                helper.getView(R.id.rec_acu_i_l).setVisibility(View.VISIBLE);
                helper.getView(R.id.rec_acu_i_r).setVisibility(View.VISIBLE);
                break;
            case 1:
                helper.getView(R.id.rec_acu_i_l).setVisibility(View.VISIBLE);
                helper.getView(R.id.rec_acu_i_r).setVisibility(View.GONE);
                break;
            case 2:
                helper.getView(R.id.rec_acu_i_l).setVisibility(View.GONE);
                helper.getView(R.id.rec_acu_i_r).setVisibility(View.VISIBLE);
                break;
            case 3:
                helper.getView(R.id.rec_acu_i_l).setVisibility(View.GONE);
                helper.getView(R.id.rec_acu_i_r).setVisibility(View.GONE);
                break;
        }
    }
}
